/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Figuras;

/**
 *
 * @author Gustavo Canul Poot
 */
public class Cuadrado extends Cuadrilatero{

    

    public Cuadrado(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
        super(x1, y1, x2, y2, x3, y3, x4, y4);
    }

    @Override
    public double area() {
        
        
       if(getDist() == 0 || getDist2()  == 0 || getDist3() == 0 || getDist4() == 0 || getDist5() == 0 || getDist6() == 0 
               ||getDist() != getDist2() || getDist() != getDist4() || getDist() != getDist6() ||
               getDist4() != getDist6() || getDist4() != getDist2() || getDist6() != getDist2())
       {
           return 0.0;
    }
           else 
           {
               return Math.pow(getDist(), 2);
           }
           
   
    }
}
